function imposeMaxLength(Object, MaxLen)
{
    if (Object.value.length > MaxLen){
        Object.value = Object.value.substr(0, MaxLen);
        return false;
    }
    return true;
}

function arr_query(url){
    var queryString = {}; 
    url.replace(new RegExp("([^?=&]+)(=([^&]*))?", "g"),
        function($0, $1, $2, $3) { 
            queryString[$1] = $3; 
        });
    return queryString;
}

function cleanDoubleSpaces(str)
{
    return str.replace(/^\s+/g,'').replace(/\s+$/g,'')
}

function fieldHighlight(field, effect){
    if(effect)
        field.style.boxShadow = "0 0 10px red";
    else
        field.style.boxShadow = "";
}